<%@ Page Title="Update Community Contacts" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCWeb.Models.Content>" %>

<%@ Register Src="~/Views/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="mmuc" %>
<%@ Register Src="~/Views/Shared/LogOnUserControl.ascx" TagName="LogOnUserControl" TagPrefix="louc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript" src='<%= Url.Content("~/Scripts/ckeditor/ckeditor.js") %>'></script>

    <script type="text/javascript" src='<%= Url.Content("~/Scripts/ckeditor/adapders/jquery.js") %>'></script>

    <script type="text/javascript" language="javascript">
        var editor = CKEDITOR.replace('Body');
    </script>

<script type="text/javascript" language="javascript">

        $(document).ready(function() {
            $('#submit').click(function() {
                var content = editor.getContent(); // get the content
                $('#Body').val(content); // put it in the textarea
            });
        });
    </script>

    <h2>
        Update Community Contacts</h2>
    <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %>
    <% using (Html.BeginForm())
       {%>
        <p>
            <textarea class="ckeditor" cols="5" id="Body" name="Body" rows="5">
                <%= HttpUtility.HtmlDecode(ViewData.Model.Body) %>
	        </textarea>
            <%= Html.ValidationMessage("Body", "*")%>
        </p>
        <p>
            <input type="submit" value="Save" />
        </p>
    <% } %>
    <div>
        <%=Html.ActionLink("Back to List", "Index") %>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
</asp:Content>
